import { $axios } from '@/utils/http';

// 通过id查找商家信息
export async function selectSaleById(params?: RecordItem) {
  return $axios.request({
    url: 'http://localhost:8090/dyh/business/selectById',
    method: 'GET',
    params,
  });
}

// 上传图片
export async function uploadImage(params?: RecordItem) {
  return $axios.request({
    url: 'http://localhost:8090/dyh/business/uploadImage',
    method: 'POST',
    params,
    isFormData: true,
  });
}

// 商家注册
export async function addBusiness(params?: RecordItem) {
  return $axios.request({
    url: 'http://localhost:8090/dyh/business/registerBusiness',
    method: 'POST',
    params,
  });
}

// 查找注册未审核的商家列表
export async function getNotReviewedList(params?: RecordItem) {
  return $axios.request({
    url: 'http://localhost:8090/dyh/business/getReviewBusinessList',
    method: 'POST',
    params,
  });
}

// 查找已审核通过的商家列表
export async function getReviewedList(params?: RecordItem) {
  return $axios.request({
    url: 'http://localhost:8090/dyh/business/getReviewedList',
    method: 'POST',
    params,
  });
}
